@extends('layout.index')

@section('title', '分类添加')

@section('content')
<div class="mws-panel grid_8">
    <div class="mws-panel-header">
        <span>分类添加</span>
    </div>
    @if (count($errors) > 0)
    <div class="mws-form-message error">
    添加失败
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
    @endif
    <div class="mws-panel-body no-padding">
        <form class="mws-form" action="/admin/sort/insert" method="post">
            <div class="mws-form-inline">
                <div class="mws-form-row">
                    <label class="mws-form-label">分类名</label>
                    <div class="mws-form-item">
                        <input type="text" name="sorname" class="small">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">分类列表</label>
                    <div class="mws-form-item">
                        <select name="parent" class="small">
                            <option value="0">顶级分类</option>
                            @foreach($sort as $k=>$v)
                            <option value="{{$v->sorid}}">{{$v->sorname}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">分类状态</label>
                    <div class="mws-form-item">
                        <select name="stute" class="small">
                            <option value="0">正在流行</option>
                            <option value="1">导航栏</option>
                            <option value="2">侧栏</option>
                            <option value="3">新品精选</option>
                            <option value="4">特级分类</option>
                        </select>
                    </div>
                </div>
            </div>
            {{csrf_field()}}
            <div class="mws-button-row">
                <input type="submit" value="添加" class="btn btn-danger">
                <input type="reset" value="重置" class="btn ">
            </div>
        </form>
    </div>      
</div>
@endsection